package com.tms.app.tms.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tms.app.tms.R;
import com.tms.app.tms.bean.Msg;
import com.tms.app.tms.utils.TimeUtil;

/**
 * Created by happy on 2017/8/26.
 */

public class MsgChangeAdapter extends BaseQuickAdapter<Msg, BaseViewHolder> {
    public MsgChangeAdapter() {
        super(R.layout.item_home_msg_msg);
    }



    @Override
    protected void convert(BaseViewHolder helper, Msg item) {
        helper.setText(R.id.item_msg_time, TimeUtil.getTime(item.getPublishTime(),TimeUtil.DEFAULT_DATE_FORMAT));
        helper.setText(R.id.item_msg_content,item.getTitle());
        helper.setText(R.id.item_content,item.getContent());
        helper.setText(R.id.item_msg_type,"【变更通知】");//0任务消息,1系统消息,2 变更通知
//        if (item.getReadStatus()==0){
//            helper.getView(R.id.item_msg_num).setVisibility(View.VISIBLE);
//        }else {
//            helper.getView(R.id.item_msg_num).setVisibility(View.INVISIBLE);
//        }
        helper.getView(R.id.item_msg_num).setVisibility(View.INVISIBLE);
    }
}
